package com.gaohe.post.service.impl;

import java.util.List;
import com.gaohe.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.post.mapper.FmPostMapper;
import com.gaohe.post.domain.FmPost;
import com.gaohe.post.service.IFmPostService;

/**
 * 圈子帖子Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-03
 */
@Service
public class FmPostServiceImpl implements IFmPostService 
{
    @Autowired
    private FmPostMapper fmPostMapper;

    /**
     * 查询圈子帖子
     * 
     * @param postId 圈子帖子主键
     * @return 圈子帖子
     */
    @Override
    public FmPost selectFmPostByPostId(Long postId)
    {
        return fmPostMapper.selectFmPostByPostId(postId);
    }

    /**
     * 查询圈子帖子列表
     * 
     * @param fmPost 圈子帖子
     * @return 圈子帖子
     */
    @Override
    public List<FmPost> selectFmPostList(FmPost fmPost)
    {
        return fmPostMapper.selectFmPostList(fmPost);
    }

    /**
     * 新增圈子帖子
     * 
     * @param fmPost 圈子帖子
     * @return 结果
     */
    @Override
    public int insertFmPost(FmPost fmPost)
    {
        fmPost.setCreateTime(DateUtils.getNowDate());
        return fmPostMapper.insertFmPost(fmPost);
    }

    /**
     * 修改圈子帖子
     * 
     * @param fmPost 圈子帖子
     * @return 结果
     */
    @Override
    public int updateFmPost(FmPost fmPost)
    {
        fmPost.setUpdateTime(DateUtils.getNowDate());
        return fmPostMapper.updateFmPost(fmPost);
    }

    /**
     * 批量删除圈子帖子
     * 
     * @param postIds 需要删除的圈子帖子主键
     * @return 结果
     */
    @Override
    public int deleteFmPostByPostIds(Long[] postIds)
    {
        return fmPostMapper.deleteFmPostByPostIds(postIds);
    }

    /**
     * 删除圈子帖子信息
     * 
     * @param postId 圈子帖子主键
     * @return 结果
     */
    @Override
    public int deleteFmPostByPostId(Long postId)
    {
        return fmPostMapper.deleteFmPostByPostId(postId);
    }
}
